﻿using MediatR;
using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using S.RBAC.Read.Api.Application.Command.OperationCommand;

namespace S.RBAC.Read.Api.Application.CommandHandlers.Operationhandler
{
    public class OperationGetAllCommandHandler : IRequestHandler<OperationGetAllCommand, List<Operation>>
    {
        protected readonly IOperationRepository _operation;

        public OperationGetAllCommandHandler(IOperationRepository operation)
        {
            _operation = operation;
        }

        public async Task<List<Operation>> Handle(OperationGetAllCommand request, CancellationToken cancellationToken)
        {
            var info = await _operation.GetAllOperation();

            return info;
        }
    }
}
